import axios from "axios"

class Base {
	// level: info,warning,success,error
	alert(msg , level="warning") {
		// window.toastr[level](msg)
	}
	async get(path,params) {
		try {
			let {data} = await axios({method:'get',url:path , params:params});
			return data
		} catch (e) {
			this.alert(e)
		}
	}
	async post(path,form , params) {
		try {
			let {data} = await axios({method:'post',url:path , params:params , data:form});
			return data
		} catch (e) {
			this.alert(e)
		}
	}
} 

export default Base